using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Travel
{
    public partial class Member : Form
    {
        private Travel.UserControls.Point ucPoint = new Travel.UserControls.Point();
        private Travel.UserControls.PointPurchase ucPointPurchase = new Travel.UserControls.PointPurchase();
        private Travel.UserControls.Payment ucPayment = new Travel.UserControls.Payment();
        private Travel.Customize objCustomize = null;

        public Member()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            tabMember_ddlStatus.SelectedIndex=0;
            DataPaymentHistory();
            tabControl1.TabPages["tabPayment"].Controls.Add(ucPayment);
            tabControl1.TabPages["tabPointPurchase"].Controls.Add(ucPointPurchase);
            //DataPoint();
            //DataPurchase(); 
            DataGuest();
        }      

        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (tabControl1.SelectedIndex == 2)
            {
                tabControl1.TabPages[2].Controls.Add(ucPoint);
            }
        }

        private void label12_Click(object sender, EventArgs e)
        {
            if (objCustomize == null)
            {
                objCustomize = new Customize();
            }
            objCustomize.Show();
        }

        private void DataGuest()
        {
            gvGuest.Rows.Add("Tran Thi Thu Thao");
            gvGuest.Rows.Add("Tran Quan Minh");
            gvGuest.Rows.Add("Truong Cao Hong Van");
        }
        private void DataPaymentHistory()
        {
            gvPaymentHistory.Rows.Add("FullPayment Fee (10%)", "3,500", "12/8/2009 19:00");
            gvPaymentHistory.Rows.Add("FullPayment Fee (40%)", "2,100", "17/9/2009 24:00");
            gvPaymentHistory.Rows.Add("FullPayment Fee (50%)", "1,700", "12/5/2010 09:00");
            gvPaymentHistory.Rows.Add("Yearly Maintainent Fee", "1,700", "12/5/2010 09:00");
            gvPaymentHistory.Rows.Add("Add-ons Fee", "1,700", "12/5/2010 09:00");
            gvPaymentHistory.Rows.Add("Member Service Fee", "1,700", "12/5/2010 09:00");

        }

        private void button3_Click(object sender, EventArgs e)
        {
            //if (objCustomize == null)
            //{
            //    objCustomize = new Customize();
            //}
            //objCustomize.Show();
        }
        //private void DataPoint()
        //{
        //    gvPoint.Rows.Add("2009", "7000", "0", "6900","100",null);
        //    gvPoint.Rows.Add("2010", "7000", "5000", "0", "0", "Maintain");
        //    gvPoint.Rows.Add("2011", "7000", "0", "0", "0", "Maintain");

        //   // gvPoint.Rows[0].Cells[5].DetachEditingControl();
        //}

        //private void DataPurchase()
        //{
        //    gvPurcharse.Rows.Add("01/02/2010","500");
        //    gvPurcharse.Rows.Add("13/02/2010", "1000");
        //    gvPurcharse.Rows.Add("21/02/2010", "1500");
        //    gvPurcharse.Rows.Add("02/03/2010", "2000");
        //}

        //private void gvPoint_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
        //{
        //    if (e.ColumnIndex == colProcess.Index)
        //    {
        //        if (e.RowIndex == 0)
        //        {
        //            e.Graphics.FillRectangle(new SolidBrush(Color.White), e.CellBounds.X, e.CellBounds.Y, e.CellBounds.Width, e.CellBounds.Height);
        //            e.Handled = true;
        //        }
        //    }
        //}                  
    }  
}